/**
 * Created by Asura on 2015/11/17.
 */
var http = require('http'),
    urls = ['www.baidu.com','www.sina.com','www.qq.com','www.&ss.com'];

function fetchPage(url){
    var date = new Date();
    http.get({host:url},function(res){
        //console.log(res);
        console.log(url +" "+ (new Date() - date));
    }).on('error',function(err){
        console.log('there is a error ' + url);
    });
}

for(var i = 0; i < urls.length; ++i) {
    fetchPage(urls[i]);
}


//文件
var fs = require('fs');

fs.readFile('d://logcat.txt','utf8',function(err,data){
    if(err) console.log(err);
    else console.log("content:"+data);
});

console.log(process.env.SECRET_KEY);
